Util = 
{
    //-------------------------------------------------------------------------------
    // Formats supplied date as an "HTTP-date" 
    // format: "Sat, 29 Oct 1994 19:43:31 GMT"
    //-------------------------------------------------------------------------------
    formatHttpDate: function(date) 
    { 
        if (undefined == date || null == date)
            throw "Argument exception. Missing date argument.";
            
        return date.toUTCString();    
    }
    ,
    //-------------------------------------------------------------------------------
    // Gets the file size of the supplied URL
    // @see: http://mootools.net/docs/Request/Request
    //-------------------------------------------------------------------------------
    getFileSize: function(url) 
    { 
        if (undefined == url || null == url)
            throw "Null argument. The url argument is required.";
        
        var result = null;
        
        var request = new Request( 
            { 
                async       : false,
                method      : "head",
                url         : url,
                onSuccess   : function(responseText, responseXml) 
                {
                    result = responseText;
                },
                onFailure   : function(instance) 
                {
                    // [!] May fail with 304 (Not Modified)
                    throw "Request failed (" + instance.status + "): " + 
                        "Unable to load from file: " + url;
                }
            }
        )
        
        request.send();
        
        var headerValue = request.getHeader("Content-Length");
        
        return parseInt(headerValue);
    }
}